package com.sqx.modules.fiction.controller.app;

import com.sqx.common.utils.Result;
import com.sqx.modules.fiction.entity.dto.SelFictionListDto;
import com.sqx.modules.fiction.service.FictionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/app/fiction")
public class AppFictionController {
    @Autowired
    private FictionService fictionService;

    /**
     * 首页-小说
     * @param selFictionListDto
     * @return
     */
    @GetMapping("/getCode")
    public Result selFictionList(@Valid SelFictionListDto selFictionListDto) {
        return fictionService.selFictionList(selFictionListDto);
    }


    /**小说详情
     *
     * @param fictionId
     * @return
     */
    @GetMapping("/getFictionDetail/{fictionId}")
    public Result getFictionDetail(@PathVariable Long fictionId) {
        return fictionService.getFictionDetail(fictionId);
    }


}
